@{
    Ajax.Dna().Widget()
        .Content(@<text>
    @{
        var context = System.Web.Mvc.DependencyResolver.Current.GetService<DNA.Mvc.Community.IForumContext>();
        var len = Convert.ToInt16(item.UserPreferences["TextLen"]);
        var threads =context.Threads.Filter(t=>t.IsApproved && !t.IsDeleted ).OrderByDescending(p => p.LastPosted).Take(Convert.ToInt16(item.UserPreferences["DispRows"])).ToList();
    }
    <ul class="ui-helper-reset" style="padding:10px;">
    @foreach (var thread in threads)
    {
        <li class="d-post-item"><a class="d-post-title" title="@thread.Title" href="@Url.Action("Index", "Thread", new { Area="Community" ,id=thread.ID})">@Html.Cut(thread.Title,len)</a> </li>
    }
    </ul>
    </text>)
        .Render();
}
